package com.right.health.app.dialog;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ListView;

import com.right.health.app.R;

/*
 * Created by hopeliao on 2019/1/5
 *
 */
public class ListBottomSheetDialog extends BaseBottomSheetDialog {

    private ListView mListView;

    public ListBottomSheetDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected int getContentViewId() {
        return R.layout.choose_doctor_dialog;
    }

    public void setOnItemClickListener(AdapterView.OnItemClickListener listener) {
        if(mListView != null) {
            mListView.setOnItemClickListener(listener);
        }
    }

    public void setAdapter(BaseAdapter adapter) {
        if(mListView != null) {
            mListView.setAdapter(adapter);
        }
    }



    @Override
    protected void findViews() {
        super.findViews();
        mListView = (ListView) findViewById(R.id.list_view);
        findViewById(R.id.tv_cancel).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }

}
